/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cc.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author gianmariospacagna
 */
@Embeddable
public class RatePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "CURRENCYFROM")
    private String currencyfrom;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "CURRENCYTO")
    private String currencyto;

    public RatePK() {
    }

    public RatePK(String currencyfrom, String currencyto) {
        this.currencyfrom = currencyfrom;
        this.currencyto = currencyto;
    }

    public String getCurrencyfrom() {
        return currencyfrom;
    }

    public void setCurrencyfrom(String currencyfrom) {
        this.currencyfrom = currencyfrom;
    }

    public String getCurrencyto() {
        return currencyto;
    }

    public void setCurrencyto(String currencyto) {
        this.currencyto = currencyto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (currencyfrom != null ? currencyfrom.hashCode() : 0);
        hash += (currencyto != null ? currencyto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RatePK)) {
            return false;
        }
        RatePK other = (RatePK) object;
        if ((this.currencyfrom == null && other.currencyfrom != null) || (this.currencyfrom != null && !this.currencyfrom.equals(other.currencyfrom))) {
            return false;
        }
        if ((this.currencyto == null && other.currencyto != null) || (this.currencyto != null && !this.currencyto.equals(other.currencyto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cc.model.RatePK[ currencyfrom=" + currencyfrom + ", currencyto=" + currencyto + " ]";
    }
    
}
